#region Microsoft Public License
/*
 * (c) Copyright Chenjun Wu. http://utablesdk.codeplex.com
 * 
 * This source is subject to the Microsoft Public License (Ms-PL).
 * Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
 * All other rights reserved.
 */
#endregion

﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UTable.Input.Text
{
    public class TextInputEventArgs: InputEventArgs
    {
        private TextInputProvider _provider;
        private String _text;
        private ControlCommand _controlCommand;


        public TextInputEventArgs(TextInputProvider provider, String text, long timestamp): base(timestamp)
        {
            _provider = provider;
            _text = text;
            _controlCommand = ControlCommand.None;
        }
        public TextInputEventArgs(TextInputProvider provider, ControlCommand command, long timestamp)
            : base(timestamp)
        {
            _provider = provider;
            _text = "";
            _controlCommand = command;
        }


        public TextInputProvider Provider
        {
            get { return _provider; }
        }

        public String Text
        {
            get { return _text; }
        }

        public ControlCommand ControlCommand
        {
            get { return _controlCommand; }
        }
    }

    public enum ControlCommand
    {
        // Summary:
        //     No key pressed.
        None = 0,
        //
        // Summary:
        //     The Cancel key.
        Cancel = 1,
        //
        // Summary:
        //     The Backspace key.
        Back = 2,
        //
        // Summary:
        //     The Clear key.
        Clear = 5,
        //
        // Summary:
        //     The Pause key.
        Pause = 7,
        //
        // Summary:
        //     The ESC key.
        Escape = 13,
        //
        // Summary:
        //     The Page Up key.
        PageUp = 19,
        //
        // Summary:
        //     The Page Down key.
        PageDown = 20,
        //
        // Summary:
        //     The End key.
        End = 21,
        //
        // Summary:
        //     The Home key.
        Home = 22,
        //
        // Summary:
        //     The Left Arrow key.
        Left = 23,
        //
        // Summary:
        //     The Up Arrow key.
        Up = 24,
        //
        // Summary:
        //     The Right Arrow key.
        Right = 25,
        //
        // Summary:
        //     The Down Arrow key.
        Down = 26,
        //
        // Summary:
        //     The Select key.
        Select = 27,
        //
        // Summary:
        //     The Print key.
        Print = 28,
        //
        // Summary:
        //     The Execute key.
        Execute = 29,
        //
        // Summary:
        //     The Insert key.
        Insert = 31,
        //
        // Summary:
        //     The Delete key.
        Delete = 32,
        //
        // Summary:
        //     The Help key.
        Help = 33,
    }

}
